#include <stdio.h>

int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    int cnt = 0;
    int tmp;
    for(int i=a;i<=b;i++)
    {
        int k = i;
        while(k>0)
        {
            tmp = k%10;
            if(tmp == 8)
            {
                cnt++;
                break;
            }
            k /= 10;
        }
    }
    printf("%d",cnt);
    return 0;
}